CC	=	g++
NAME1	=	mendoza-smtp
NAME2	=	mendoza-pop
SRCS1	=	main.cpp				\
		ClientList.cpp				\
		common.cpp				\
		Connection.cpp				\
		HandleInformations.cpp			\
		MutexUnix.cpp				\
		Parser.cpp				\
		ServerUnix.cpp				\
		ThreadUnix.cpp
SRCS2	=	main.cpp				\
		ClientList.cpp				\
		common.cpp				\
		Connection.cpp				\
		HandleInformations.cpp			\
		MutexUnix.cpp				\
		Parser.cpp				\
		ServerUnix.cpp				\
		ThreadUnix.cpp
OBJS1	=	$(SRCS1:.cpp=.o)
OBJS2	=	$(SRCS2:.cpp=.o)
CFLAGS	=	-W -Wall -Wextra -Werror
LB	=	-lm -lpthread

all : $(NAME1) $(NAME2)

$(NAME1) : $(OBJS1)
	$(CC) -o $(NAME1) $(OBJS1) $(CFLAGS) $(LB)

$(NAME2) : $(OBJS2)
	$(CC) -o $(NAME2) $(OBJS2) $(CFLAGS) $(LB)

clean :
	rm -f $(OBJS1)
	rm -f $(NAME1)
	rm -f $(OBJS2)
	rm -f $(NAME2)

fclean : clean
	rm -rf *~
	rm -rf *#

re : clean all

.PHONY: all clean fclean re
